home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1320
/
1320.xpi
/
chrome
/
gmanager.jar
/
content
/
overlay.xml
< prev
next >
Wrap
Extensible Markup Language
|
2010-01-22
|
5KB
|
173 lines
<?xml version="1.0" encoding="UTF-8"?>
<!--
Gmail Manager
By Todd Long <longfocus@gmail.com>
http://www.longfocus.com/firefox/gmanager/
-->
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="gmanager-account-info">
<content context="_child" tooltip="_child">
<children includes="menupopup|tooltip"/>
<xul:hbox align="center">
<xul:image class="gmanager-icon"
xbl:inherits="iconsize,icontype,status,newMail"/>
<xul:label class="gmanager-unread"
value=""
xbl:inherits="value=unread"/>
<xul:label class="gmanager-alias"
value=""
xbl:inherits="value=alias"/>
</xul:hbox>
</content>
<implementation implements="nsIObserver">
<constructor>
<![CDATA[
var observer = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observer.addObserver(this, gmanager_Accounts.NOTIFY_STATE, false);
]]>
</constructor>
<destructor>
<![CDATA[
this.destroy();
]]>
</destructor>
<property name="account"
onget="return this._account;">
<setter>
<![CDATA[
this._account = val;
this.setAttribute("id", "gmanager-toolbar-panel-" + val.email);
this.updatePosition();
]]>
</setter>
</property>
<property name="displayAccount"
onget="return this._displayAccount;">
<setter>
<![CDATA[
this._displayAccount = val;
this.updateDisplay();
]]>
</setter>
</property>
<method name="destroy">
<body>
<![CDATA[
try {
var observer = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observer.removeObserver(this, gmanager_Accounts.NOTIFY_STATE);
} catch(e) {}
if (this.parentNode)
this.parentNode.removeChild(this);
]]>
</body>
</method>
<method name="updateDisplay">
<body>
<![CDATA[
if (this._displayAccount)
{
var unread = this._displayAccount.unread;
this.setAttribute("icontype", this._displayAccount.type);
this.setAttribute("status", gmanager_Utils.toStyleStatus(this._displayAccount.status));
this.setAttribute("newMail", unread > 0 ? "true" : "false");
this.setAttribute("unread", !this._displayAccount.getBoolPref("toolbar-account-hide-unread-count") && this._displayAccount.loggedIn ? unread : "");
this.setAttribute("alias", !this._displayAccount.getBoolPref("toolbar-account-hide-alias") ? gmanager_Utils.toUnicode(this._displayAccount.alias) : "");
}
]]>
</body>
</method>
<method name="updatePosition">
<body>
<![CDATA[
if (this._account)
{
var isToolbarDisplay = this._account.getBoolPref("toolbar-display");
if (isToolbarDisplay)
{
var toolbar = document.getElementById(this._account.getCharPref("toolbar-toolbar-id"));
var toolbarPosition = this._account.getIntPref("toolbar-specific-position");
if (toolbar === null)
toolbar = document.getElementById("status-bar");
if (this._account.getCharPref("toolbar-placement") == "always-last" || (toolbar.childNodes && toolbar.childNodes.length <= toolbarPosition))
toolbar.appendChild(this);
else
toolbar.insertBefore(this, toolbar.childNodes[toolbarPosition]);
}
this.setAttribute("hidden", !isToolbarDisplay);
}
]]>
</body>
</method>
<method name="observe">
<parameter name="aSubject"/>
<parameter name="aTopic"/>
<parameter name="aData"/>
<body>
<![CDATA[
if (aTopic == gmanager_Accounts.NOTIFY_STATE)
{
// aSubject : null
// aTopic : gmanager_Accounts.NOTIFY_STATE
// aData : email|status (e.g. longfocus@gmail.com|10)
var email = (aData ? aData.split("|")[0] : null);
if (this._displayAccount && this._displayAccount.email == email)
this.updateDisplay();
}
]]>
</body>
</method>
</implementation>
</binding>
<binding id="gmanager-toolbar-menuitem"
extends="chrome://global/content/bindings/menu.xml#menuitem">
<content type="radio">
<xul:hbox class="menu-iconic-left"
align="center"
pack="center"
xbl:inherits="selected,checked">
<xul:image class="menu-iconic-icon"
xbl:inherits="src=image"/>
</xul:hbox>
<xul:label class="menu-iconic-text"
flex="1"
xbl:inherits="value=alias"/>
<xul:label xbl:inherits="value=unread"/>
<xul:image class="gmanager-icon"
iconsize="small"
xbl:inherits="icontype,status,newMail"/>
</content>
</binding>
</bindings>